useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.6.0_17'

	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'protoStoreSales3b.bin')
		click('Edit1')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,0')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,1')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,3')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Expand Tree')
		select('LayoutCombo', 'Product')
		select('JTreeTable', 'rows:[5,6,7],columns:[keycode]')
		select_menu('View>>Table View #{Selected Records#}')
		select('JTreeTable', 'rows:[5,6,7],columns:[keycode]')
		select('Table', '-1621479474', '1|keycode,1')
		select('Table', '4011822', '2|saleDate,1')
		select('Table', 'cell:3|quantity,1(-1)')
		assert_p('Table', 'Content', '[[69684558, 40118, 1, 19000], [-1621479474, 4011822, -1, -19000], [69684558, 40118, 1, 5010]]')
		select('Table', 'cell:3|quantity,1(-1)')
		select_menu('Window>>protoStoreSales3b.bin>>Tree View')
		select('Table', 'cell:3|quantity,1(-1)')
		select('JTreeTable', 'cell:saleDate,6(4011822)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 69684558, 40118, 1, 19000], [, , -1621479474, 4011822, -1, -19000], [, , 69684558, 40118, 1, 5010], [, , 69694158, 40118, 1, 19000], [, , 69694158, 40118, -1, -19000], [, , 69694158, 40118, 1, 5010], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
		click('BaseDisplay$HeaderToolTips', 'keycode')
		click('BaseDisplay$HeaderToolTips', 'saleDate')
		select('JTreeTable', 'cell:saleDate,6(4011822)')
		select_menu('Window>>protoStoreSales3b.bin>>Tree View')
		select('JTreeTable', 'cell:saleDate,6(4011822)')
		select_menu('Window>>protoStoreSales3b.bin>>Table:')
##		select('JTreeTable', 'cell:saleDate,6(4011822)')
		select('Table', 'cell:3|quantity,1(-1)')
		select('Table', 'cell:3|quantity,1(-1)')
		click('BaseDisplay$HeaderToolTips', '2|saleDate')
		select('Table', '401182', '2|saleDate,1')
##		select('Table', '4011822', '2|saleDate,1')
		select('Table', 'cell:2|saleDate,1(401182)')
		click('BaseDisplay$HeaderToolTips', '1|keycode')
		select('Table', '169684558', '1|keycode,1')
##		select('Table', 'cell:3|quantity,1(-1)')
		select('Table', '401182', '2|saleDate,1')
##		select('Table', 'cell:2|saleDate,1(401182)')

##		assert_p('Table', 'Content', '[[69684558, 40118, 1, 19000], [169684558, 401182, -1, -19000], [69684558, 40118, 1, 5010]]')
		assert_p('Table', 'Content', '[[69684558, 40118, 1, 19000], [169684558, 401182, -1, -19000], [69684558, 40118, 1, 5010]]')

##		zzzzzzz
		select('Table', 'cell:2|saleDate,1(401182)')
		select_menu('Window>>protoStoreSales3b.bin>>Tree View')
		select('Table', 'cell:2|saleDate,1(401182)')
		select('JTreeTable', 'cell:keycode,6(169684558)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 69684558, 40118, 1, 19000], [, , 169684558, 401182, -1, -19000], [, , 69684558, 40118, 1, 5010], [, , 69694158, 40118, 1, 19000], [, , 69694158, 40118, -1, -19000], [, , 69694158, 40118, 1, 5010], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
		select_menu('Utilities>>Compare with Disk')
		##select('Table', 'cell:keycode,0(69684558)')
		assert_p('Table', 'Content', '[[, Old, 7, 69684558, 40118, -1, -19000], [, New, 7, 169684558, 401182, , ]]')
		assert_p('Table', 'Content', '[[, Old, 7, 69684558, 40118, -1, -19000], [, New, 7, 169684558, 401182, , ]]')
		
		select('Table', 'cell:keycode,0(69684558)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3b.bin>>Tree View')
		click('Save1')
		select_menu('Utilities>>Compare with Disk')
		assert_p('TextPane', 'Text', 'Files are Identical !!!')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select_menu('Window>>protoStoreSales3b.bin>>Tree View')
		select('JTreeTable', '69684558', 'keycode,6')
		select('JTreeTable', 'cell:saleDate,6(401182)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 69684558, 40118, 1, 19000], [, , 69684558, 401182, -1, -19000], [, , 69684558, 40118, 1, 5010], [, , 69694158, 40118, 1, 19000], [, , 69694158, 40118, -1, -19000], [, , 69694158, 40118, 1, 5010], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
		select_menu('Window>>protoStoreSales3b.bin>>Table:')
		select('Table', 'cell:2|saleDate,1(401182)')
		select('Table', 'cell:2|saleDate,1(401182)')
		assert_p('Table', 'Content', '[[69684558, 40118, 1, 19000], [69684558, 401182, -1, -19000], [69684558, 40118, 1, 5010]]')
		select('Table', 'cell:2|saleDate,1(401182)')
		select_menu('Utilities>>Compare with Disk')
##		select('Table1', 'cell:2|saleDate,1(401182)')
		select('Table', 'cell:saleDate,0(401182)')
		assert_p('Table', 'Content', '[[, Old, 7, 169684558, 401182, -1, -19000], [, New, 7, 69684558, , , ]]')
		select('Table', 'cell:saleDate,0(401182)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:2|saleDate,1(401182)')
		select('Table', 'cell:2|saleDate,1(401182)')
		select_menu('Window>>protoStoreSales3b.bin>>Tree View')
		select('Table', 'cell:2|saleDate,1(401182)')
		select('JTreeTable', '40118', 'saleDate,6')
		select('JTreeTable', 'cell:saleDate,6(40118)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 69684558, 40118, 1, 19000], [, , 69684558, 40118, -1, -19000], [, , 69684558, 40118, 1, 5010], [, , 69694158, 40118, 1, 19000], [, , 69694158, 40118, -1, -19000], [, , 69694158, 40118, 1, 5010], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
		
		select_menu('Window>>protoStoreSales3b.bin>>Table:')
		select('Table', 'cell:2|saleDate,1(40118)')
		select('Table', 'cell:2|saleDate,1(40118)')
		assert_p('Table', 'Content', '[[69684558, 40118, 1, 19000], [69684558, 40118, -1, -19000], [69684558, 40118, 1, 5010]]')
		select('Table', 'cell:2|saleDate,1(40118)')
		select_menu('Utilities>>Compare with Disk')
##		select('Table1', 'cell:2|saleDate,1(40118)')
		select('Table', 'cell:keycode,0(169684558)')
		assert_p('Table', 'Content', '[[, Old, 7, 169684558, 401182, -1, -19000], [, New, 7, 69684558, 40118, , ]]')
		select('Table', 'cell:keycode,0(169684558)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:2|saleDate,1(40118)')
		select('Table', 'cell:2|saleDate,1(40118)')
		click('Save')
	close()
